package com.xuxiao.config;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author xuxiao
 */
@Component
public class SpringListenerForError  implements ApplicationListener<SpringEventForError> {


    @Override
    public void onApplicationEvent(SpringEventForError event) {
        Throwable source = (Exception) event.getSource();
        System.out.println(source.getMessage());
    }
}
